package com.hui.server.entity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
 * <p>
 * 
 * </p>
 *
 * @author hui
 * @since 2022-03-31
 */
@Getter
@Setter
@ToString
@Accessors(chain = true)
@TableName("t_nation")
@ApiModel(value = "Nation对象", description = "")
@RequiredArgsConstructor//会生成一个包含常量，和标识了NotNull的变量的构造方法。生成的构造方法是私有的private
@NoArgsConstructor
@EqualsAndHashCode(callSuper = false,of = "name")//生成 name 的hashcode和equals方法
public class Nation implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty("id")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty("民族")
    @TableField("name")
    @Excel(name = "民族")
    @NonNull//如果为空会报错
    private String name;


}
